import 'package:azlistview_plus/azlistview_plus.dart';
import 'package:city_pickers/city_pickers.dart';
import 'package:city_pickers/modal/base_citys.dart';
import 'package:get/get.dart';
import 'package:study_demo/base/BaseController.dart';

import 'data/province.dart';

class AzListController extends BaseController {
  CityPickerUtil cityPickerUtils = CityPickers.utils();
  final cityList = <CityModel>[].obs;
  List<CityModel> _hotCityList = [];

  String code = '110101';

  Result result = Result();

  late List<Point> provinces;

  @override
  void onInit() {
    super.onInit();
    provinces = new Provinces(metaInfo: provincesData).provinces;

    getCities();
  }

  getCities() {
    provinces.forEach((element) {
      // print('name${element.name}');
      _hotCityList.add(CityModel(element.name));
    });
    cityList.addAll(_hotCityList);
  }
}

class CityModel extends ISuspensionBean {
  String name;

  CityModel(this.name);

  @override
  String getSuspensionTag() {
    return name;
  }
}
